﻿package dk.gaming.rummikub.uicomponents
{
	import flash.display.MovieClip;
	import flash.text.TextField;
	import dk.gaming.rummikub.backend.Proxy;
	import flash.events.MouseEvent;
	import dk.gaming.rummikub.events.ProxyEvent;
	import dk.gaming.rummikub.appcontext.AppContext;
	import dk.gaming.rummikub.events.GameEvent;
	
	public class GameListItem extends MovieClip
	{
		
		private var _ID : String;
		private override var _name : String;
		private var _PlayerCount : Number;
		
		private var IDText : TextField;
		private var nameText : TextField;
		private var PlayerCountText : TextField;
		public var JoinButton : MovieClip;
		
	
		
		
		public function GameListItem($ID:String, $name:String, $PlayerCount:Number)
		{
			IDText = idtf;
			nameText = nametf;
			PlayerCountText = playercounttf;
			JoinButton = joinbtn;
			
			proxy = new Proxy();
			
			JoinButton.buttonMode = true;
			JoinButton.addEventListener(MouseEvent.CLICK, AttemptToJoin);
		}
		
		
		public function set ID($ID:String):void
		{
			this._ID = $ID;
			IDText.text = $ID;
		}
		
		public function get ID():String
		{
			return _ID;
		}
		
		public function set Name($name:String):void
		{
			this._name = $name;
			nameText.text = $name;
		}
		
		public function get Name():String
		{
			return _name;
		}
		
		public function set PlayerCount($PlayerCount:Number):void
		{
			this._PlayerCount = $PlayerCount;
			PlayerCountText.text = String($PlayerCount);
		}
		
		public function get PlayerCount():Number
		{
			return _PlayerCount;
		}

		
		
	}
	
	
}